package com.bankcomm.iccard;

import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;

import com.bankcomm.R;
import com.bankcomm.common.ConfigManager;
import com.bankcomm.common.LPMid;
import com.bankcomm.ui.views.BCMHomeView;
import com.bankcomm.ui.views.LPBottomBar;
import com.bankcomm.ui.views.LPManageHome;
import com.bankcomm.util.LPUtils;

public class ICCard_Deal_Logquery_Activity extends BaseActivity implements OnClickListener  {
	Button btnReturn, btnHome;
	LinearLayout ic_deal_log_prompt ;
	private LPBottomBar bottomBar;
	private RelativeLayout topLayout;
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.iccard_deal_log_layout);
		bottomBar=(LPBottomBar)findViewById(R.id.bottom_bar);
		topLayout=(RelativeLayout)findViewById(R.id.titleLayout);
		ic_deal_log_prompt=(LinearLayout)findViewById(R.id.ic_deal_log_prompt);
		btnReturn = (Button) findViewById(R.id.backtitle);
		btnHome = (Button) findViewById(R.id.hometitle);
		((LPBottomBar) findViewById(R.id.bottom_bar)).setSelectTab(2);
		setLayoutHeight();
		btnReturn.setOnClickListener(this);
		btnHome.setOnClickListener(this);
	}
	
	private void setLayoutHeight() {
		LPUtils.scaledTHeightRel(topLayout);
		LPUtils.setTitleButtonWH(btnReturn);
		LPUtils.setTitleButtonWH(btnHome);
		
	}

	@Override
	public void onClick(View v) {
//		Bundle inBundle = new Bundle();
		switch (v.getId()) {
		case R.id.backtitle:
			this.finish();
			break;
		case R.id.hometitle:
//			LPMid.getInstance().um_.backToHome(this, 0);		
			ConfigManager.currentView_.finish();
			BCMHomeView.changeScrollTab(2);
			this.finish();
			break;
		}
	}

	@Override
	public boolean onKeyDown(int keyCode, KeyEvent event) {
		if (event.getAction() == KeyEvent.ACTION_DOWN) {
			if (keyCode == KeyEvent.KEYCODE_BACK) {
				this.finish();
				return true;
			}
		}
		return false;
	}

	@Override
	public void finish() {
		super.finish();
	}
}
